package hottargui.domain.standard;

import java.util.ArrayList;
import java.util.List;
import java.util.ListIterator;
import java.util.Random;

import hottargui.domain.*;

public class StandardShuffleStrategyImpl implements  ShuffleStrategy {

	private List<Card> _cards;

	public List<Card> shuffle(List<Card> lc) {

		_cards = lc;

		Random rand = new Random();
		List<Card> cardsTmp = new ArrayList<Card>();

		ListIterator<Card> li = _cards.listIterator();

		while (li.hasNext()) {

			int newRandomPosition = rand.nextInt(_cards.size());
			Card cardRandom = _cards.remove(newRandomPosition);
			cardsTmp.add(cardRandom);

		}

		return cardsTmp;	


	}

}
